package com.example.demo.controller;

import com.example.demo.commen.Result;
import com.example.demo.model.BlogInfo;
import com.example.demo.service.BlogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/blog")
public class BlogController {

   // @Autowired

    @Autowired
    private BlogService blogService;
    @RequestMapping("/getList")
    public List<BlogInfo> getBlogLists(){
        return blogService.getBlogLists();

    }


    @RequestMapping("/getBlogDetail")
    public BlogInfo getBlogDetail(Integer blogId){
        System.out.println("dadadaxxxx");
        BlogInfo blogInfo = blogService.getBlogInfo(blogId);
         return blogInfo;

    }
}
